package com.sz.designpattern.construct7.composite;


import java.util.ArrayList;
import java.util.List;

public class Compoiste implements Componet{
    private List<Componet> lists = new ArrayList<>();
    @Override
    public void doSth() {
        for (Componet com : lists) {
            com.doSth();
        }
    }

    public void add(Componet componet){
        lists.add(componet);
    }

    public void remove(Componet componet){
        lists.remove(componet);
    }
}
